package com.fenghongzhang.mvp_lib.presenter;


import com.fenghongzhang.mvp_lib.model.IModel;
import com.fenghongzhang.mvp_lib.view.IView;

import io.reactivex.disposables.Disposable;

public class BasePresenter<M extends IModel,V extends IView> implements IPresenter {

    protected Disposable disposable;

    protected M mModel;
    protected V mView;

    public BasePresenter(M mModel, V mView) {
        this.mModel = mModel;
        this.mView = mView;
    }
    @Override
    public void destroy() {
        if(disposable != null){
            disposable.dispose();
            disposable=null;
        }
    }
}
